package com.simple_factory2;

/**
 * 简单工厂模式:工厂类
 */
public class DrinkFactory {
    //生产饮料,卖给顾客
    public static Drink produceDrink(String drinkName){
        if("coke".equals(drinkName)){
            return new Coke();
        }else if("spite".equals(drinkName)){
            return new Spite();
        }else if("duice".equals(drinkName)){
            return new Duice();
        }else{
            System.out.println("没有该产品");
            return null;
        }
    }
}
